<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>离职登记</title>
<link href="../style/main.css" rel="stylesheet" type="text/css" />
<link type="text/css" rel="stylesheet" href="../css/style.css" />

<script>

 function changeV(objID)
			{
				if(document.getElementById("tbody_"+objID).style.display == "")
				{
					
					document.getElementById("img_"+objID).src = "../images/ico_have2.gif";
					document.getElementById("tbody_"+objID).style.display = "none"
				}
				else
				{
					document.getElementById("img_"+objID).src = "../images/ico_nohave2.gif";
					document.getElementById("tbody_"+objID).style.display = ""
				}
			}
function editSeparation(){
var comps_del = document.getElementsByName("separations");
	var count = 0;
	var index = 0; 
	for(var i = 0; i < comps_del.length; i ++){
		if(comps_del[i].checked){
			count ++;
			index = i;
		}
	}
	if(count == 1){
		window.location.href = "separationAction!findSeparationById.action?separation.separationId="+comps_del[index].value;
	}
	else{
		window.alert("请选择一个编辑选项");
	}
	return false;
}

function delSeparation(){
var comps_del = document.getElementsByName("separations");
	var count = 0;
	var index = 0; 
	for(var i = 0; i < comps_del.length; i ++){
		if(comps_del[i].checked){
			count ++;
			index = i;
		}
	}
	if(count == 1){
		window.location.href = "separationAction!deleteSeparation.action?separation.separationId="+comps_del[index].value;
	}
	else{
		window.alert("请选择一个 删除选项");
	}
	return false;
}
</script>

</head>
<body>
<table width="1200" align="left" cellpadding="0" cellspacing="0" class="table">
  <tr>
    <td>
      <table width="100%"  cellpadding="0" cellspacing="0" class="table2">
        <tr>
          <td valign="top">
            <table width="100%" class="top" cellpadding="0" cellspacing="0">
              <tr>
                <td>当前位置:&nbsp;人事管理&nbsp;&gt;&gt; 离职登记<a href="#"></a></td>
              </tr>
            </table>
			<div id="mainareacontent">
        <div class="mainarea">
        <s:form action="separationAction!findSeparationByCondition" method="post" theme="simple" id="inquire">
            <div class="search">			
			 
                <table width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td height="209" class="ico">
                            <a href="javascript:changeV(1)">
                                <img src="../images/ico_have2.gif" id="img_1" border="0"/></a>                        </td>
                      <td ><table cellpadding="0" cellspacing="0" width="100%" >
                        <tr>
                          <td width="9%" height="30" align="right">离职员工编号： </td>
                          <td width="12%"><s:textfield name="separation.employee.employeeId"/></td>
                          <td width="8%" align="right">离职职员名：</td>
                          <td width="15%"><s:textfield name="separation.employee.employeeNameC"/>
                          </td>
                          <td width="8%" align="right">离职时间： </td>
                          <td width="27%"><s:textfield name="separationDateStart"/>
                            至<s:textfield name="separationDateEnd"/></td>
                          <td width="21%"><img src="../images/btn_search.gif" onclick="document.getElementById('inquire').submit()"/></td>
                        </tr>
                        <tbody id="tbody_1" style="display: none; border: 0px;">
                        </tbody>
                      </table></td>
                    </tr>
                </table>
            </div>
            <!----------- 数据列表 ------------------>
            <fieldset>
                <legend>
                    <table width="100%" cellpadding="0" cellspacing="0"class="table3">
                        <tr>
                            <td width="6%" class="title">&nbsp;</td>
                            <td width="5%" ><span class="clientinfo_but" ><a href="separationAction!initSeparation.action">新&nbsp;增</a></span></td>
                            <td width="5%" ><span class="clientinfo_but"><a href="#" onclick="return editSeparation();">修&nbsp;改</a></span></td>
                            <td width="5%" ><img src="../images/btn_del.gif" alt="3" onclick="return delSeparation()"/></td>
                            <td width="18%" >&nbsp;</td>
                            <td width="5%" ><span class="clientinfo_but">导&nbsp;入</span></td>
                            <td width="5%" ><span class="clientinfo_but">导&nbsp;出</span></td>
                          
                            <td width="5%" ><span class="clientinfo_but">打&nbsp;印</span></td>  
                            <td width="14%" >&nbsp;</td>
                        </tr>
                    </table>
            </legend>
            <table width="100%" cellpadding="0" cellspacing="1" class="dg_borderstyle">
              <thead>
                <tr>
                  <th width="77" height="52">&nbsp;</th>
                  <th width="112">记录编号</th>
                  <th width="111">员工编号</th>
                  <th width="108">员工姓名</th>
                  <th width="120">离职时间</th>
                  <th width="153">离司时属于转司标志</th>
                  <th width="128">四联单编号</th>
                  <th width="108">离职原因</th>
                </tr>
              </thead>
              <tbody >
              <s:iterator value="separationList">
			  <tr align="center">
                  <td width="77" height="52"><input type="radio" name="separations"  value="<s:property value='separationId'/>"/></td>
                  <td width="112"><s:property value="separationId"/></td>
                  <td width="111"><s:property value="employee.employeeId"/></td>
                  <td width="108"><s:property value="employee.employeeNameC"/></td>
                  <td width="120"><s:date name="separationDate" format="yyyy-MM-dd"/></td>
                  <td width="153"><s:if test="isSwitch">是<s:else>否</s:else></s:if></td>
                  <td width="128"><s:property value="forCheck"/></td>
                  <td width="108"><s:property value="sepReason"/></td>
                </tr>
                </s:iterator>
              </tbody>
            </table>
            </fieldset>
            <table width="100%" cellpadding="0" cellspacing="0" class="dg_pagestyle">
                <tr>
                    <td class="pageinfo">
                         共<s:property value="pager.pageCount"/>页/<s:property value="pager.recordCount"/>条记录                    </td>
                    <td class="pagebutton">
                        每页
                        <s:select list="#{'1':'1','20':'20','50':'50'}" name="pager.pageSize">
                        </s:select>
                        条记录 | 第<s:textfield name="pager.pageCurrent" cssStyle="width: 20px;" id="pagecurrent"/>页<img src="../images/btn_go.gif" onclick="document.getElementById('inquire').submit();"/>
                        <img src="../images/btn_sy.gif" onclick="goToPage(1)"/>
                         <s:if test="pager.pageCurrent > 1">
                        <img src="../images/btn_syy.gif" onclick="goToPage(<s:property value='pager.pageCurrent - 1'/>)"/>
                        </s:if>
                        <s:if test="pager.pageCurrent < pager.pageCount">
                        <img src="../images/btn_xyy.gif" onclick="goToPage(<s:property value='pager.pageCurrent + 1'/>)"/>
                        </s:if>
                        <img src="../images/btn_wy.gif" onclick="goToPage(<s:property value='pager.pageCount'/>)"/></td>
                </tr>
            </table>
       </s:form>
        </div>
        
        
      </div>          </td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<script type="text/javascript">
function goToPage(page){
	document.getElementById("pagecurrent").value = page;
	document.getElementById("inquire").submit();
}
</script>
</body>
</html>
